<?php
//队列邮件
$config = require_once '../../config.php';


$redis = new Redis();
$redis->connect($config['redis_ip'], $config['redis_port']);//ip端口
$redis->auth($config['redis_auth']);//密码
$redis_key = 'email';

if($redis->lLen($redis_key)){
    $arr = $redis->lrange($redis_key, 0 ,-1);//返回数组
    $items = [];
    foreach ($arr as $item){
        $items[] = json_decode($item,1);
    }
    echo json_encode(['code'=>true, 'msg'=>'', 'data'=>$items]);
}else{
    echo json_encode(['code'=>false, 'msg'=>'没有更多数据了']);
}
